<?php

// 数组相关知识点练习

$student = array(
	'name' => 'yangzh',
	'No.'  => 'P16122323232',
	'url'  => 'https://gitee.com/yangjh/php2018.git',
);

$array = [1, 2, 3, 4, 5];

// 函数练习
//
function p($var = '') {
	echo "<pre>";
	var_dump($var);
	echo "</pre>";
}

p($student);
p($student['name']);
p($array);
p($array[4]);

// 比较运算符

$a = true;
$b = 'true';

p($a == $b);
p($a === $b);

// 错误抑制符@
@p($c);

// 执行shell命令

$output = `ls`;
p($output);

// 字符串拼接
$str1 = '西北民族';
$str2 = '大学';

echo $str1 . $str2;

// 流程控制
$total = 1000000;
if ($total == 3000000) {
	echo '终于有钱买车了';
} else {
	echo '加油！';
}

while ($total <= 10000000) {
	$total = $total - 100000;
	p($total);
}
